#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QtSerialPort/QSerialPort>//提供串口功能
#include <QtSerialPort/QSerialPortInfo>//系统串口访问功能  KEY
#include <QTimer>//改变思路：接收用定时器https://blog.csdn.net/imkelt/article/details/51058170
#include <QButtonGroup>
namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
    QSerialPort serial;
    QTimer *timer;
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    char Com_Flash(void);
    char comcount;
    QByteArray requestData;//（用于存储从串口那读取的数据）

    QButtonGroup *btnGroupsend;
    QButtonGroup *btnGroupreceive;

    char GetHexBitsValue(char ch);
    QByteArray ToDigitsBytes(char* theHex);
private slots:
    void on_pushButton_1_clicked();

    void on_pushButton_3_clicked();

    void on_pushButton_2_clicked();
    void readyReadSlot();
    void comreadyReadSlot();

    void on_pushButton_4_clicked();
    void onRadioClickRceived();
    void onRadioClickSend();

private:
    Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H
